package picoevo.gp.representation;

import picoevo.core.representation.MemoryModule;
import picoevo.toolbox.Display;

public class MemoryModule_Individual_MultipleBooleanRegisters extends MemoryModule {

	// ### Data ###

	private boolean register[];

	// ### Constructors ###

	public MemoryModule_Individual_MultipleBooleanRegisters(int __size) {
		register = new boolean[__size];
	}

	// ### Methods ###

	public void setRegister(int __index, boolean __value) {
		if (__index < 0 || __index > register.length) {
			Display.critical("MemoryModule_Individual_MultipleBooleanRegisters::setRegister(.,.) - index out of bounds! (index=" + __index + ";length=" + register.length + ")");
			System.exit(-1);
		}
		register[__index] = __value;
	}

	public boolean getRegister(int __index) {
		if (__index < 0 || __index > register.length) {
			Display.critical("MemoryModule_Individual_MultipleBooleanRegisters::getRegister(.) - index out of bounds! (index=" + __index + ";length=" + register.length + ")");
			System.exit(-1);
		}
		return register[__index];
	}

	public int getRegisterSize() {
		return register.length;
	}

}

// 20060705n
